|
![](/i/fill.gif) |
"JRG" <jrg### [at] hotmail com> wrote in message
news:3b77c829@news.povray.org...
> > I'm guessing (not knowing exactly how macros work) that
> > when the objects are put into the first array the macros are
> > executed and the results put in the array. Is there any way inside
> > pov-ray to have the macros storred in the array and only executed
> > when the objects are written out?
>
> You guessed well. Why don't you just write as foolows:
>
As I said, that was simplified code. I'm writing
a macro to pile objects up (planning later to take
gravity and friction into account.) I want to allow
any number of different objects with different probabilities.
The macro as currently written takes an array of objects and an array of
probailities
eg
// very pseudo-code
#declare ObjectsArray=array[4] {Object1,Object2,Object3,Object4}
#declare ProbArray = array[4] {0.5,0.2,0.2,0.1}
Pile(ObjectsArray,ProbArray)
In the above case 50% of the pile will be object1, 20% object2 etc
Gail
--
*************************************************************************
* gsh### [at] monotix co za * Step into the abyss, *
* http://www.rucus.ru.ac.za/~gail/ * and let go. Babylon 5 *
*************************************************************************
* The difficult we do immediately, the impossible takes a little longer *
*************************************************************************
Post a reply to this message
|
![](/i/fill.gif) |